package com.woniu.smallmedical.server.serverimpl;

import com.woniu.smallmedical.entity.Department;
import com.woniu.smallmedical.entity.PageBean;
import com.woniu.smallmedical.mapper.DepartmentMapper;
import com.woniu.smallmedical.server.DepartmentServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServerImpl implements DepartmentServer {
    @Autowired
    DepartmentMapper departmentMapper;
    @Override
    public List<Department> getAllDepartment() {
        List<Department> allDepartment = departmentMapper.getAllDepartment();
        return allDepartment;
    }

    @Override
    public List<Department> departmentList(PageBean pageBean) {
        List<Department> departments = departmentMapper.departmentList(pageBean);

        return departments;
    }

    @Override
    public int getCount() {
        int count = departmentMapper.getCount();
        return count;
    }

    @Override
    public int changeswitch(Department department) {
        int count  = departmentMapper.changeswitch(department);
        return count;
    }

    @Override
    public List<Department> departmentListByUrl(PageBean pageBean) {
        List<Department> departments = departmentMapper.departmentListByUrl(pageBean);

        return departments;
    }

    @Override
    public int addDepartment(Department department) {
        int count =departmentMapper.addDepartment(department);
        return count;
    }

    @Override
    public int changedepartmentListInfo(Department department) {
        int count = departmentMapper.changedepartmentListInfo(department);

        return count;
    }

    @Override
    public int deleteDepartment(Department department) {
        int count = departmentMapper.deleteDepartment(department);
        return count;
    }
}
